notify() Method |
This method displays notifications such as validation messages and process completion indicators.
Syntax
application.notify(sMessage,[sTitle],[oControl],[oFeedbackObject]);
Parameters
Parameter |
Description |
---|---|
sMessage |
Required. String that denotes the notification message to be displayed. |
sTitle |
Optional. String that denotes the title of the notification message. |
oControl |
Optional. An HTML object that refers to the control for which the notification is issued. When specified for a control, the notification message is positioned near the control, instead of being stacked with other notification messages. |
oFeedbackObject |
Optional. A JavaScript object that helps convert the notification description into a hyperlink. Clicking the description opens the detailed message in a separate window. This object comprises the following properties:
|
Return Value
It does not return a value.
Remarks
You must provide the textual content to be displayed as the notification. Notifications display buttons that enable the user to close them and automatically fade out after an interval of five seconds.
In the case of controls, notifications appear as validation messages. In the case of application windows, notifications are stacked on the window from which they originate.
Example
The following example demonstrates how to display stacked notification messages.
function showStackedNotification() { var feedbackObject = new Object(); // inputName is the Id of html Element. feedbackObject.relatedHTMLElement = document.getElementById("inputName"); feedbackObject.callbackFunction = callbackHandler; feedbackObject.applicationDefinition = newApplication.documentElement; application.notify("Click Here to execute the callback function.", "Test", null, feedbackObject); } function callbackHandler() { // the code to be executed onclick of the notification message link. } <script type="cordys/xml" id="newApplication"> <Application> <url>Application URL </url> <id>Application Id</id> <caption>Application caption</caption> <description>Application description</description> <frame>main</frame> <data/> </Application> </script> <html> <body> <div> <label>Name:<label><inputid="inputName" class="input" type="text"> </div> </body> </html>
The following example demonstrates how to display a notification message for an HTML element.
function showNotificationNearInput() { var feedbackObject = new Object(); // inputName is the Id of html Element. feedbackObject.relatedHTMLElement = document.getElementById("inputName"); feedbackObject.callbackFunction = callbackHandler; feedbackObject.applicationDefinition = newApplication.documentElement; application.notify("Click Here to execute the callback function.", "Test", document.getElementById("inputName"), feedbackObject); } function callbackHandler() { // the code to be executed onclick of the notification message link. } <script type="cordys/xml" id="newApplication"> <Application> <url>Application URL </url> <id>Application Id</id> <caption>Application caption</caption> <description>Application description</description> <frame>main</frame> <data/> </Application> </script> <html> <body> <div> <label>Name :</label><input id="inputName" class="input" type="text"/> </div> </body> </html>